package ex.com.jm.food.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 企业类型实体
 * @author zhaojw
 *
 */
@Entity
@Table(name="jm_companytype")
public class CompanyType implements Serializable {

	private static final long serialVersionUID = 1L;
   
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="comtype_id",nullable=false,unique=true,length=11)
   private Integer comtypeId;//主键
	@Column(name="comtype_name",nullable=false,unique=true,length=32)
   private String comtypeName;//类型名称
	@Column(name="created",nullable=false,length=32)
   private String created;//创建时间
	@Column(name="status",nullable=false,length=11)
	private Integer status;
	@OneToMany(mappedBy="comtypeId",fetch=FetchType.EAGER)
	private Set<Company> companies=new HashSet<Company>();
	public Integer getComtypeId() {
		return comtypeId;
	}
	public void setComtypeId(Integer comtypeId) {
		this.comtypeId = comtypeId;
	}
	public String getComtypeName() {
		return comtypeName;
	}
	public void setComtypeName(String comtypeName) {
		this.comtypeName = comtypeName;
	}
	public String getCreated() {
		return created;
	}
	public void setCreated(String created) {
		this.created = created;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Set<Company> getCompanies() {
		return companies;
	}
	public void setCompanies(Set<Company> companies) {
		this.companies = companies;
	}

}
